<?php
class Admin_Model_DbTable_promotionvip extends Zend_Db_Table_Abstract
{
	 protected $_name = 'hae_promotion_vip';
	 protected $_sequence=true;
     protected $_primary='id';
	public function addpromotionvip($desc_vi, $desc_en, $desc_ja, $desc_cn, $desc_fr, $image, $price, $begin, $end)
	{
		$data = array(
		'image'   => $image,
		'price'   => $price,
		'desc_vi' => $desc_vi,
		'desc_en' => $desc_en,
		'desc_ja' => $desc_ja,
		'desc_cn' => $desc_cn,
		'desc_fr' => $desc_fr,
		'begin'   => $begin,
		'end'     => $end,
		);
		$this->insert($data);
	}
	public function getpromotionvip($id)
	{
	    $id = (int)$id;
	    $row = $this->fetchRow('id=' . $id);
		if(!$row)
		{ 
			throw  new Exception("Could not find row {$id}");
		}
		return $row->toArray();
	}
	public function updatepromotionvip($id, $desc_vi, $desc_en, $desc_ja, $desc_cn, $desc_fr, $image, $price, $begin, $end)
	{
		$data = array(
		'image'   => $image,
		'price'   => $price,
		'desc_vi' => $desc_vi,
		'desc_en' => $desc_en,
		'desc_ja' => $desc_ja,
		'desc_cn' => $desc_cn,
		'desc_fr' => $desc_fr,
		'begin'   => $begin,
		'end'     => $end,
		);
		$this->update($data, 'id = '. (int)$id);
	}
	public function deletepromotionvip($id)
    {
        return $this->delete('id =' . (int)$id);
    }
}
?>